<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

//Route::get('think', function () {
//    return 'hello,ThinkPHP5!';
//});
//
//Route::get('hello/:name', 'index/hello');
Route::get('/', 'index/index');

// Demo
//Route::group('group', function () {
//    Route::get('read/:id', 'read')->name('group_read');;
//    Route::get('write/:id', 'write')->name('group_write');;
//    Route::get('del/:id', 'del')->name('group_del');;
//    Route::get('index/:id', 'index')->name('group_index');;
//})->prefix('group/');

// Auth
Route::group('/auth', function () {
    Route::post('login','/admin/auth/login')->name('auth_login');
})->prefix('auth/')->allowCrossDomain();

Route::group('/article', function () {
    // 列表
    Route::get('','/admin/article/index')->name('article_index');
    // 详情
    Route::get('/:id','/admin/article/info')->name('article_info');
    // 增加
    Route::post('','/admin/article/add')->name('article_add');
    // 修改
    Route::put('/:id','/admin/article/edit')->name('article_edit');
    // 删除
    Route::delete('/:id','/admin/article/del')->name('article_del');

})->prefix('article/')->allowCrossDomain();

// User
Route::group('/user', function () {
    // 详情
    Route::get('/info','/admin/user/info')->name('user_info');
})->prefix('user/')->allowCrossDomain();

// 测试提交

return [

];
